package test;

import common.Utils;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.time.Duration;

/**
 * Created with IntelliJ IDEA
 * Descroption
 * User:dell
 * Date:2025-09-09
 * Time:11:05
 */
public class ExitPage extends Utils {
    public static String url = "http://81.70.248.108:58080/index.html";

    public ExitPage() {
        super(url);
    }
    /**
     * 退出功能
     */
    public void exit(){
        WebDriverWait indexWait = new WebDriverWait(webDriver, Duration.ofSeconds(10));
        indexWait.until(ExpectedConditions.elementToBeClickable(By.xpath("/html/body/div[1]/header[1]/div/div/div[3]/a")));

        webDriver.findElement(By.xpath("/html/body/div[1]/header[1]/div/div/div[3]/a")).click();

        indexWait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@id=\"index_user_logout\"]")));
        webDriver.findElement(By.xpath("//*[@id=\"index_user_logout\"]")).click();
    }

}
